package com.yanqu.road.server.cmd.activity.ghost;

import com.yanqu.road.entity.activity.ghost.config.GhostConfig;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.ghost.GhostMgr;
import com.yanqu.road.server.manger.activity.ghost.GhostSceneLogic;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_GHOST_QUIT_BOSS_ROOM, desc = "退出boss房间")
public class GhostQuitBossRoomCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        GhostConfig ghostConfig = GhostMgr.getGhostConfig();
        if (!ActivityMgr.activityInTime(ghostConfig.getActivityInfo())) {
            return;
        }

        GhostSceneLogic.quitRoom(player.getUserId());
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
